package com.chenfan.mcn.dao;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.chenfan.mcn.constant.NumberCst;
import com.chenfan.common.extension.mybatisplus.enhanced.EnhancedBaseMapper;
import com.chenfan.mcn.model.ExcuteFeedback;
import org.apache.ibatis.annotations.Mapper;

/**
 * @author tangwei
 * Date:     2021/1/26 19:21
 * Description: 执行反馈
 */
@Mapper
public interface ExcuteFeedbackMapper extends EnhancedBaseMapper<ExcuteFeedback> {

    /**
     * 根据执行单ID获取执行反馈
     * @param excutionOrderId
     * @return
     */
    default ExcuteFeedback getByExcuteId(Long excutionOrderId) {
        return this.selectOne(Wrappers.lambdaQuery(ExcuteFeedback.class)
                .eq(ExcuteFeedback::getExcutionOrderId, excutionOrderId)
                .eq(ExcuteFeedback::getIsDelete, NumberCst.ZERO));
    }
}